package com.archermind.sessionpool;

import static java.util.concurrent.TimeUnit.SECONDS;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;

import com.archermind.boc.Logger;

public class SessionPoolProtect  {
	private static Logger log = Logger.getLogger(SessionPoolProtect.class
			.getName());
	@SuppressWarnings("unused")
	public final static int POLL_SECOND = 5;

	public void checkSession(int second) {

		PullPool pull = new PullPool();

		ScheduledExecutorService scheduler = Executors
				.newScheduledThreadPool(1);
		log.info("[session pool] start!!!");

		@SuppressWarnings("unused")
		ScheduledFuture<?> beeperHandle = scheduler.scheduleAtFixedRate(pull, 0,
				POLL_SECOND, SECONDS);

	}
}

class PullPool implements Runnable{
	public void run() {
		BizSessionPool.protectBizs();
	}
}
